home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-07-05 | 54.2 KB | 1,812 lines |
- Path: uunet!olivea!oliveb!veritas!amdcad!sun!exodus!bea.lbl.gov
- From: envbvs@bea.lbl.gov (Brian V. Smith)
- Newsgroups: comp.sources.x
- Subject: v13i070: xfig2, Patch10, Part03/04
- Message-ID: <16333@exodus.Eng.Sun.COM>
- Date: 6 Jul 91 06:59:21 GMT
- References: <csx-13i068-xfig2.9@uunet.UU.NET>
- Sender: news@exodus.Eng.Sun.COM
- Lines: 1800
- Approved: argv@sun.com
-
- Submitted-by: envbvs@bea.lbl.gov (Brian V. Smith)
- Posting-number: Volume 13, Issue 70
- Archive-name: xfig2.9/patch10.03
- Patch-To: xfig2.9: Volume XXX, Issue XXX
- Patch-To: xfig2.9: Volume 10, Issue 26-31
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 3 (of 4)."
- # Contents: patch10.1
- # Wrapped by envbvs@bea.lbl.gov.lbl.gov on Fri Jun 14 14:37:03 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'patch10.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patch10.1'\"
- else
- echo shar: Extracting \"'patch10.1'\" \(51690 characters\)
- sed "s/^X//" >'patch10.1' <<'END_OF_FILE'
- X*** @xfig.pl9/CHANGES Fri Sep 21 10:16:36 1990
- X--- ./CHANGES Fri Jun 14 12:47:59 1991
- X***************
- X*** 1,5 ****
- X--- 1,68 ----
- X Version 2.0
- X
- X+ Patchlevel 10
- X+ Changes from patchlevel 9:
- X+
- X+ o zooming and panning is now possible for all objects except texts.
- X+ Use new buttons, arrow keys for panning. See the man page.
- X+ From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
- X+ o selecting one of several overlapping objects is implemented for
- X+ most functions.
- X+ Hold down Shift key while clicking on object to cycle through
- X+ candidate objects, release shift key for selection. See man page.
- X+ From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
- X+ o dash length and dot gap width can be modified using the Change menu
- X+ From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
- X+ o dash length scaled to line width and zoom factor
- X+ From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
- X+ o multiple Grid Sizes
- X+ Two grids are available in the -metric mode
- X+ From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
- X+ o open polygons and splines can be filled
- X+ From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
- X+ o new resource 'Startfontsize' and command line option -startfontsize
- X+ From Georg Sigl (ges@regent.e-technik.tu-muenchen.de)
- X+ o point markers displayed with text objects
- X+ From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
- X+ o grid and ruler bitmaps are created dynamically
- X+ This was neccessary for the zoom and pan commands
- X+ From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
- X+ o changing text by clicking on it has to be finished with the left
- X+ button. Finishing with the middle button is no longer possible
- X+ (this is rather a workaround for the bug that gave interesting
- X+ effects)
- X+ From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
- X+ o if a point is to be deleted from a line, at least 2 points must remain
- X+ From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
- X+ o fixed bug where finishing text with middle button, saving figure
- X+ and trying to quit made xfig claim the figure hadn't been saved
- X+ o fixed bug where line of zero length with an arrow head would cause f2ps
- X+ to divide by zero
- X+ o there is a bug in OpenWindows which causes xfig to crash when trying to
- X+ create the pixmaps from one-plane bitmaps for the button icons. According
- X+ to the Intrinsics manual, the XtNbitmap resource in a widget will auto-
- X+ matically be converted to the proper screen depth, but OpenWindows seems
- X+ not to do this. Add the define "-DOPENWIN" to the "DEFINES" line
- X+ in the Imakefile if you are running OpenWindows.
- X+ o depth of objects is now honored - set object depth with popup change window
- X+ From Mike Lutz <mjl@cs.rit.edu>
- X+ o bug fixed where "create object -> read file -> undo" would delete objects
- X+ Tom Tkacik (tkacik@hobbes.cs.gmr.com)
- X+ o creation of text is now undoable
- X+ o text inside compound is erased properly when compound is moved/deleted etc
- X+ o f2ps now uses the -s (font size) option when objects are defined
- X+ with default font size (-1)
- X+ From Ian Dall <idall@augean.ua.oz.au>
- X+ o font spacing button value no longer crashes xfig on MIPS type machine
- X+ o having spline where two or more points are coincident no longer
- X+ gives DOMAIN error or crashes xfig
- X+ From Mike Lawley <lawley@muse.cs.mu.oz.au>
- X+ o attempting to draw arc with two or more coincident points no longer
- X+ crashes xfig
- X+ o definition of errno, sys_nerr and sys_errlist moved to fig.h
- X+ From Casey Leedem <casey@gauss.llnl.gov>
- X+ o removed startup message printing to stdout
- X+
- X Patchlevel 9
- X Changes from patchlevel 8:
- X
- X***************
- X*** 41,47 ****
- X longer supported :-(
- X o Moved initializing of Fig icon in main() to work with mwm
- X From David Elliot <dce@smsc.sony.com>
- X! o f2p and f2ps now return meaningfull error codes: 0 for OK, 1 for error
- X o Errors in reading figure file should report correct line numbers now
- X o Handles "default" font for TransFig correctly
- X o Text input is now correctly terminated whenever a menu item is chosen,
- X--- 104,110 ----
- X longer supported :-(
- X o Moved initializing of Fig icon in main() to work with mwm
- X From David Elliot <dce@smsc.sony.com>
- X! o f2p and f2ps now return meaningful error codes: 0 for OK, 1 for error
- X o Errors in reading figure file should report correct line numbers now
- X o Handles "default" font for TransFig correctly
- X o Text input is now correctly terminated whenever a menu item is chosen,
- X*** @xfig.pl9/Imakefile Fri Sep 21 09:54:58 1990
- X--- ./Imakefile Tue Jun 11 17:17:59 1991
- X***************
- X*** 14,23 ****
- X ellipse.c file.c flip.c font.c free.c geom.c\
- X global.c glue.c graphics.c grid.c intspline.c\
- X latex_line.c line.c list.c main.c move.c movept.c\
- X! msgsw.c panel.c popup.c print.c printfonts.c psbits.c\
- X! psfonts.c puterr.c read.c read1_3.c redisplay.c\
- X! remove.c rotate.c ruler.c save.c scale.c search.c\
- X! spline.c text.c trans.c turn.c undo.c util.c xtra.c
- X
- X XFIGOBJ = addpt.o arc.o arcbox.o arrow.o autoarrow.o bitmap.o\
- X blink.o bound.o box.o break.o canvas.o change.o\
- X--- 14,24 ----
- X ellipse.c file.c flip.c font.c free.c geom.c\
- X global.c glue.c graphics.c grid.c intspline.c\
- X latex_line.c line.c list.c main.c move.c movept.c\
- X! msgsw.c pan.c panel.c popup.c print.c printfonts.c\
- X! psbits.c psfonts.c puterr.c read.c read1_3.c\
- X! redisplay.c remove.c rotate.c ruler.c save.c scale.c\
- X! search.c spline.c text.c trans.c turn.c undo.c util.c\
- X! xtra.c zoom.c
- X
- X XFIGOBJ = addpt.o arc.o arcbox.o arrow.o autoarrow.o bitmap.o\
- X blink.o bound.o box.o break.o canvas.o change.o\
- X***************
- X*** 25,35 ****
- X cursor.o curve.o deletept.o dir.o drag.o draw.o\
- X ellipse.o file.o flip.o font.o free.o geom.o global.o\
- X glue.o graphics.o grid.o intspline.o latex_line.o\
- X! line.o list.o main.o move.o movept.o msgsw.o panel.o\
- X! popup.o print.o printfonts.o psbits.o psfonts.o\
- X puterr.o read.o read1_3.o redisplay.o remove.o\
- X rotate.o ruler.o save.o scale.o search.o spline.o\
- X! text.o trans.o turn.o undo.o util.o xtra.o
- X
- X F2PSRC = arrow.c f2p.c free.c read.c read1_3.c troff_fonts.c psfonts.c
- X F2POBJ = arrow.o f2p.o free.o read.o read1_3.o troff_fonts.o psfonts.o
- X--- 26,36 ----
- X cursor.o curve.o deletept.o dir.o drag.o draw.o\
- X ellipse.o file.o flip.o font.o free.o geom.o global.o\
- X glue.o graphics.o grid.o intspline.o latex_line.o\
- X! line.o list.o main.o move.o movept.o msgsw.o pan.o\
- X! panel.o popup.o print.o printfonts.o psbits.o psfonts.o\
- X puterr.o read.o read1_3.o redisplay.o remove.o\
- X rotate.o ruler.o save.o scale.o search.o spline.o\
- X! text.o trans.o turn.o undo.o util.o xtra.o zoom.o
- X
- X F2PSRC = arrow.c f2p.c free.c read.c read1_3.c troff_fonts.c psfonts.c
- X F2POBJ = arrow.o f2p.o free.o read.o read1_3.o troff_fonts.o psfonts.o
- X*** @xfig.pl9/Makefile Thu Jul 5 14:42:05 1990
- X--- ./Makefile Fri Jun 14 10:33:36 1991
- X***************
- X*** 244,253 ****
- X ellipse.c file.c flip.c font.c free.c geom.c\
- X global.c glue.c graphics.c grid.c intspline.c\
- X latex_line.c line.c list.c main.c move.c movept.c\
- X! msgsw.c panel.c popup.c print.c printfonts.c psbits.c\
- X! psfonts.c puterr.c read.c read1_3.c redisplay.c\
- X! remove.c rotate.c ruler.c save.c scale.c search.c\
- X! spline.c text.c trans.c turn.c undo.c util.c xtra.c
- X
- X XFIGOBJ = addpt.o arc.o arcbox.o arrow.o autoarrow.o bitmap.o\
- X blink.o bound.o box.o break.o canvas.o change.o\
- X--- 244,254 ----
- X ellipse.c file.c flip.c font.c free.c geom.c\
- X global.c glue.c graphics.c grid.c intspline.c\
- X latex_line.c line.c list.c main.c move.c movept.c\
- X! msgsw.c pan.c panel.c popup.c print.c printfonts.c\
- X! psbits.c psfonts.c puterr.c read.c read1_3.c\
- X! redisplay.c remove.c rotate.c ruler.c save.c scale.c\
- X! search.c spline.c text.c trans.c turn.c undo.c util.c\
- X! xtra.c zoom.c
- X
- X XFIGOBJ = addpt.o arc.o arcbox.o arrow.o autoarrow.o bitmap.o\
- X blink.o bound.o box.o break.o canvas.o change.o\
- X***************
- X*** 255,265 ****
- X cursor.o curve.o deletept.o dir.o drag.o draw.o\
- X ellipse.o file.o flip.o font.o free.o geom.o global.o\
- X glue.o graphics.o grid.o intspline.o latex_line.o\
- X! line.o list.o main.o move.o movept.o msgsw.o panel.o\
- X! popup.o print.o printfonts.o psbits.o psfonts.o\
- X puterr.o read.o read1_3.o redisplay.o remove.o\
- X rotate.o ruler.o save.o scale.o search.o spline.o\
- X! text.o trans.o turn.o undo.o util.o xtra.o
- X
- X F2PSRC = arrow.c f2p.c free.c read.c read1_3.c troff_fonts.c psfonts.c
- X F2POBJ = arrow.o f2p.o free.o read.o read1_3.o troff_fonts.o psfonts.o
- X--- 256,266 ----
- X cursor.o curve.o deletept.o dir.o drag.o draw.o\
- X ellipse.o file.o flip.o font.o free.o geom.o global.o\
- X glue.o graphics.o grid.o intspline.o latex_line.o\
- X! line.o list.o main.o move.o movept.o msgsw.o pan.o\
- X! panel.o popup.o print.o printfonts.o psbits.o psfonts.o\
- X puterr.o read.o read1_3.o redisplay.o remove.o\
- X rotate.o ruler.o save.o scale.o search.o spline.o\
- X! text.o trans.o turn.o undo.o util.o xtra.o zoom.o
- X
- X F2PSRC = arrow.c f2p.c free.c read.c read1_3.c troff_fonts.c psfonts.c
- X F2POBJ = arrow.o f2p.o free.o read.o read1_3.o troff_fonts.o psfonts.o
- X***************
- X*** 389,391 ****
- X--- 390,393 ----
- X ###########################################################################
- X # dependencies generated by makedepend
- X
- X+ # DO NOT DELETE THIS LINE -- make depend depends on it.
- X*** @xfig.pl9/addpt.c Mon Apr 30 12:12:44 1990
- X--- ./addpt.c Fri Jun 14 09:01:14 1991
- X***************
- X*** 15,22 ****
- X #include "object.h"
- X #include "paintop.h"
- X
- X- #define TOLERANCE 3
- X-
- X extern F_line *line_search();
- X extern F_spline *spline_search();
- X extern (*canvas_kbd_proc)();
- X--- 15,20 ----
- X***************
- X*** 38,43 ****
- X--- 36,44 ----
- X extern F_point *added_point;
- X extern F_point *left_point, *right_point;
- X
- X+ extern int init_object_search();
- X+ extern int object_search();
- X+
- X extern int init_point_adding();
- X extern int move_addedpoint();
- X extern int fix_linepoint_adding();
- X***************
- X*** 52,81 ****
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! canvas_leftbut_proc = init_point_adding;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X set_cursor(&pick9_cursor);
- X }
- X
- X! init_point_adding(x, y)
- X int x, y;
- X {
- X- int px, py;
- X
- X! if ((cur_line = line_search(x, y, TOLERANCE, &px, &py)) != NULL) {
- X! if (cur_line->type == T_BOX || cur_line->type == T_ARC_BOX) {
- X put_msg("Adding points to a box is not allowed");
- X return;
- X }
- X init_linepointadding(px, py);
- X! }
- X! else if ((cur_spline = spline_search(x,y,TOLERANCE,&px,&py)) != NULL){
- X init_splinepointadding(px, py);
- X! }
- X! else {
- X! return;
- X! }
- X canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
- X erase_pointmarker();
- X }
- X--- 53,88 ----
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! /* store handler address with object search function */
- X! init_object_search(init_point_adding);
- X! canvas_leftbut_proc = object_search;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X set_cursor(&pick9_cursor);
- X }
- X
- X! init_point_adding(p,type,x, y,px,py)
- X! char *p;
- X! int type;
- X int x, y;
- X+ int px, py;
- X {
- X
- X! switch(type)
- X! { case O_POLYLINE:
- X! cur_line=(F_line *) p;
- X! if (cur_line->type == T_BOX || cur_line->type ==T_ARC_BOX) {
- X put_msg("Adding points to a box is not allowed");
- X return;
- X }
- X init_linepointadding(px, py);
- X! break;
- X! case O_SPLINE:
- X! cur_spline=(F_spline *) p;
- X init_splinepointadding(px, py);
- X! break;
- X! default: return;
- X! }
- X canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
- X erase_pointmarker();
- X }
- X***************
- X*** 183,198 ****
- X find_endpoints(cur_line->points,px,py,&left_point,&right_point);
- X set_temp_cursor(&null_cursor);
- X win_setmouseposition(canvas_win, px, py);
- X cur_x = fix_x = px; cur_y = fix_y = py;
- X if (left_point == NULL && cur_line->type == T_POLYGON) {
- X left_point = right_point;
- X right_point = right_point->next;
- X }
- X if (left_point != NULL && right_point != NULL)
- X pw_vector(canvas_win, left_point->x, left_point->y,
- X! right_point->x, right_point->y, INV_PAINT,
- X cur_line->thickness, cur_line->style, cur_line->style_val);
- X! draw_addedlink(INV_PAINT);
- X if (latexline_mode || latexarrow_mode) {
- X canvas_locmove_proc = latex_elasticline;
- X canvas_middlebut_proc = mm_fix_linepoint_adding;
- X--- 190,209 ----
- X find_endpoints(cur_line->points,px,py,&left_point,&right_point);
- X set_temp_cursor(&null_cursor);
- X win_setmouseposition(canvas_win, px, py);
- X+
- X+ /* set cur_x etc at new point coords */
- X cur_x = fix_x = px; cur_y = fix_y = py;
- X if (left_point == NULL && cur_line->type == T_POLYGON) {
- X left_point = right_point;
- X right_point = right_point->next;
- X }
- X+ /* erase line segment where new point is */
- X if (left_point != NULL && right_point != NULL)
- X pw_vector(canvas_win, left_point->x, left_point->y,
- X! right_point->x, right_point->y, ERASE,
- X cur_line->thickness, cur_line->style, cur_line->style_val);
- X! /* draw in rubber-band line */
- X! draw_addedlink(PAINT);
- X if (latexline_mode || latexarrow_mode) {
- X canvas_locmove_proc = latex_elasticline;
- X canvas_middlebut_proc = mm_fix_linepoint_adding;
- X***************
- X*** 305,310 ****
- X--- 316,324 ----
- X *fp = a;
- X *sp = b;
- X }
- X+
- X+ /* draw rubber-band lines between left-point and cur_x/y and between
- X+ right point and cur_x/y */
- X
- X draw_addedlink(op)
- X int op;
- X*** @xfig.pl9/arc.c Tue May 1 16:33:45 1990
- X--- ./arc.c Mon Jun 3 11:12:55 1991
- X***************
- X*** 110,117 ****
- X
- X x = point[0].x; y = point[0].y;
- X for (i = 1; i < num_point; i++) {
- X! pw_vector(canvas_win, x, y, point[i].x, point[i].y, INV_PAINT,
- X! 1, SOLID_LINE, 0.0);
- X x = point[i].x; y = point[i].y;
- X }
- X if (num_point < 3) {
- X--- 110,117 ----
- X
- X x = point[0].x; y = point[0].y;
- X for (i = 1; i < num_point; i++) {
- X! pw_vector(canvas_win, x, y, point[i].x, point[i].y,
- X! INV_PAINT, 1, RUBBER_LINE, 0.0);
- X x = point[i].x; y = point[i].y;
- X }
- X if (num_point < 3) {
- X***************
- X*** 132,138 ****
- X arc->type = T_3_POINTS_ARC;
- X arc->style = line_style;
- X arc->thickness = line_thickness;
- X! arc->style_val = cur_styleval;
- X arc->pen = 0;
- X arc->area_fill = fill_mode? cur_areafill : 0;
- X arc->color = cur_color;
- X--- 132,139 ----
- X arc->type = T_3_POINTS_ARC;
- X arc->style = line_style;
- X arc->thickness = line_thickness;
- X! /* scale dash length according to linethickness */
- X! arc->style_val = cur_styleval*(line_thickness+1)/2;
- X arc->pen = 0;
- X arc->area_fill = fill_mode? cur_areafill : 0;
- X arc->color = cur_color;
- X*** @xfig.pl9/arcbox.c Mon Apr 30 12:12:48 1990
- X--- ./arcbox.c Mon Jun 3 11:12:56 1991
- X***************
- X*** 89,95 ****
- X box->depth = 0;
- X box->pen = 0;
- X box->area_fill = fill_mode? cur_areafill : 0;
- X! box->style_val = cur_styleval;
- X box->radius = cur_radius; /* corner radius */
- X box->for_arrow = NULL;
- X box->back_arrow = NULL;
- X--- 89,96 ----
- X box->depth = 0;
- X box->pen = 0;
- X box->area_fill = fill_mode? cur_areafill : 0;
- X! /* multiply dash length by line thickness */
- X! box->style_val = cur_styleval*(line_thickness+1)/2;
- X box->radius = cur_radius; /* corner radius */
- X box->for_arrow = NULL;
- X box->back_arrow = NULL;
- X*** @xfig.pl9/autoarrow.c Tue May 1 16:23:11 1990
- X--- ./autoarrow.c Mon Jun 3 11:12:59 1991
- X***************
- X*** 13,20 ****
- X #include "object.h"
- X #include "paintop.h"
- X
- X- #define TOLERANCE 7
- X-
- X extern (*canvas_kbd_proc)();
- X extern (*canvas_locmove_proc)();
- X extern (*canvas_leftbut_proc)();
- X--- 13,18 ----
- X***************
- X*** 32,39 ****
- X
- X F_point *selected_point, *left_point;
- X int arcpoint_num;
- X! extern int add_arrow_head();
- X! extern int delete_arrow_head();
- X
- X #define round(x) ((int) (x + .5))
- X
- X--- 30,39 ----
- X
- X F_point *selected_point, *left_point;
- X int arcpoint_num;
- X! int add_arrow_head();
- X! int delete_arrow_head();
- X! extern int point_search();
- X! extern int point_search_middle();
- X
- X #define round(x) ((int) (x + .5))
- X
- X***************
- X*** 41,101 ****
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! canvas_leftbut_proc = add_arrow_head;
- X! canvas_middlebut_proc = delete_arrow_head;
- X canvas_rightbut_proc = set_popupmenu;
- X set_cursor(&pick9_cursor);
- X }
- X
- X! add_arrow_head(x, y)
- X! int x, y;
- X {
- X F_line *line;
- X F_spline *spline;
- X F_arc *arc;
- X
- X! if ((line = line_point_search(x, y, TOLERANCE,
- X! &left_point, &selected_point)) != NULL) {
- X! add_linearrow(line);
- X! }
- X! else if ((spline = spline_point_search(x, y,
- X! TOLERANCE, &left_point, &selected_point)) != NULL){
- X! add_splinearrow(spline);
- X! }
- X! else if ((arc = arc_point_search(x, y, TOLERANCE,
- X! &arcpoint_num)) != NULL) {
- X! add_arcarrow(arc);
- X! }
- X! else
- X return;
- X
- X set_modifiedflag();
- X }
- X
- X! delete_arrow_head(x, y)
- X! int x, y;
- X {
- X F_line *line;
- X F_spline *spline;
- X F_arc *arc;
- X
- X! if ((line = line_point_search(x, y, TOLERANCE,
- X! &left_point, &selected_point)) != NULL) {
- X! delete_linearrow(line);
- X! }
- X! else if ((spline = spline_point_search(x, y,
- X! TOLERANCE, &left_point, &selected_point)) != NULL){
- X! delete_splinearrow(spline);
- X! }
- X! else if ((arc = arc_point_search(x, y, TOLERANCE,
- X! &arcpoint_num)) != NULL) {
- X! delete_arcarrow(arc);
- X! }
- X! else
- X return;
- X!
- X set_modifiedflag();
- X! }
- X
- X add_linearrow(line)
- X F_line *line;
- X--- 41,118 ----
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! /* store handler address with point_search */
- X! init_point_search(add_arrow_head);
- X! init_point_search_middle(delete_arrow_head);
- X! canvas_leftbut_proc = point_search;
- X! canvas_middlebut_proc = point_search_middle;
- X canvas_rightbut_proc = set_popupmenu;
- X set_cursor(&pick9_cursor);
- X }
- X
- X! add_arrow_head(obj, type, x, y, p, q)
- X! char *obj;
- X! int type,x,y;
- X! F_point *p,*q;
- X {
- X F_line *line;
- X F_spline *spline;
- X F_arc *arc;
- X
- X! left_point=p;
- X! selected_point=q;
- X! switch(type)
- X! { case O_POLYLINE:
- X! line=(F_line *) obj;
- X! add_linearrow(line);
- X! break;
- X! case O_SPLINE:
- X! spline=(F_spline *) obj;
- X! add_splinearrow(spline);
- X! break;
- X! case O_ARC:
- X! /* arcpoint_num is stored in x coordinate - dirty trick */
- X! arcpoint_num=(int) p;
- X! arc=(F_arc *) obj;
- X! add_arcarrow(arc);
- X! break;
- X! default:
- X return;
- X+ }
- X
- X set_modifiedflag();
- X }
- X
- X! delete_arrow_head(obj, type, x, y, p, q)
- X! char *obj;
- X! int type,x,y;
- X! F_point *p,*q;
- X {
- X F_line *line;
- X F_spline *spline;
- X F_arc *arc;
- X
- X! left_point=p;
- X! selected_point=q;
- X! switch(type)
- X! { case O_POLYLINE:
- X! line=(F_line *) obj;
- X! delete_linearrow(line);
- X! break;
- X! case O_SPLINE:
- X! spline=(F_spline *) obj;
- X! delete_splinearrow(spline);
- X! break;
- X! case O_ARC:
- X! arcpoint_num=(int) p;
- X! arc=(F_arc *) obj;
- X! delete_arcarrow(arc);
- X! break;
- X! default:
- X return;
- X! }
- X set_modifiedflag();
- X! }
- X
- X add_linearrow(line)
- X F_line *line;
- X*** @xfig.pl9/bitmap.c Thu Jul 5 14:48:24 1990
- X--- ./bitmap.c Mon Jun 3 13:25:15 1991
- X***************
- X*** 15,27 ****
- X extern int CANVAS_WIDTH, CANVAS_HEIGHT;
- X extern F_compound objects;
- X
- X- extern int errno;
- X extern int pointmarker_shown;
- X extern int compoundbox_shown;
- X extern appresStruct appres;
- X-
- X- extern char *sys_errlist[];
- X- extern int sys_nerr, errno;
- X
- X write_bitmap(file_name)
- X char *file_name;
- X--- 15,23 ----
- X*** @xfig.pl9/box.c Tue May 1 16:40:15 1990
- X--- ./box.c Mon Jun 3 11:13:02 1991
- X***************
- X*** 63,72 ****
- X draw_rectbox(x1, y1, x2, y2, op)
- X int x1, y1, x2, y2, op;
- X {
- X! pw_vector(canvas_win, x1, y1, x1, y2, op, 1, SOLID_LINE, 0.0);
- X! pw_vector(canvas_win, x1, y2, x2, y2, op, 1, SOLID_LINE, 0.0);
- X! pw_vector(canvas_win, x2, y2, x2, y1, op, 1, SOLID_LINE, 0.0);
- X! pw_vector(canvas_win, x2, y1, x1, y1, op, 1, SOLID_LINE, 0.0);
- X }
- X
- X elastic_box(x, y)
- X--- 63,73 ----
- X draw_rectbox(x1, y1, x2, y2, op)
- X int x1, y1, x2, y2, op;
- X {
- X! /* linewidth = RUBBER_LINE means don't scale */
- X! pw_vector(canvas_win, x1, y1, x1, y2, op, 1, RUBBER_LINE, 0.0);
- X! pw_vector(canvas_win, x1, y2, x2, y2, op, 1, RUBBER_LINE, 0.0);
- X! pw_vector(canvas_win, x2, y2, x2, y1, op, 1, RUBBER_LINE, 0.0);
- X! pw_vector(canvas_win, x2, y1, x1, y1, op, 1, RUBBER_LINE, 0.0);
- X }
- X
- X elastic_box(x, y)
- X***************
- X*** 109,115 ****
- X box->depth = NULL;
- X box->pen = 0;
- X box->area_fill = fill_mode? cur_areafill : 0;
- X! box->style_val = cur_styleval;
- X box->radius = 0;
- X box->for_arrow = NULL;
- X box->back_arrow = NULL;
- X--- 110,117 ----
- X box->depth = NULL;
- X box->pen = 0;
- X box->area_fill = fill_mode? cur_areafill : 0;
- X! /* scale dash length by line thickness */
- X! box->style_val = cur_styleval*(line_thickness+1)/2;
- X box->radius = 0;
- X box->for_arrow = NULL;
- X box->back_arrow = NULL;
- X*** @xfig.pl9/canvas.c Tue May 1 16:33:46 1990
- X--- ./canvas.c Mon Jun 3 13:25:15 1991
- X***************
- X*** 11,23 ****
- X #include "resources.h"
- X #include "const.h"
- X #include "paintop.h"
- X
- X /***************** import global variables and routines *******************/
- X
- X extern int cur_command;
- X- extern int errno;
- X extern int action_on; /* tracker.c */
- X extern int magnet_mode;
- X
- X extern int CANVAS_WIDTH, CANVAS_HEIGHT;
- X extern null_proc();
- X--- 11,26 ----
- X #include "resources.h"
- X #include "const.h"
- X #include "paintop.h"
- X+ #include "zoom.h"
- X+ #include <X11/keysym.h>
- X+ #include "X11/X.h" /* for ShiftMask */
- X
- X /***************** import global variables and routines *******************/
- X
- X extern int cur_command;
- X extern int action_on; /* tracker.c */
- X extern int magnet_mode;
- X+ extern int grid2_mode;
- X
- X extern int CANVAS_WIDTH, CANVAS_HEIGHT;
- X extern null_proc();
- X***************
- X*** 28,34 ****
- X--- 31,39 ----
- X extern (*canvas_rightbut_proc)();
- X extern null_proc();
- X extern set_popupmenu();
- X+ extern appresStruct appres;
- X
- X+ extern int gc_thickness[NUMOPS]; /* for zoom */
- X
- X /*********************** local variables and routines ************************/
- X
- X***************
- X*** 174,185 ****
- X XButtonPressedEvent *be = (XButtonPressedEvent *)event;
- X XKeyPressedEvent *ke = (XKeyPressedEvent *)event;
- X
- X! x = event->x;
- X! y = event->y;
- X if (magnet_mode)
- X {
- X! x = ((t = x % 5) < 3) ? x - t - 1 : x + 5 - t - 1;
- X! y = ((t = y % 5) < 3) ? y - t - 1 : y + 5 - t - 1;
- X }
- X switch (event->type)
- X {
- X--- 179,208 ----
- X XButtonPressedEvent *be = (XButtonPressedEvent *)event;
- X XKeyPressedEvent *ke = (XKeyPressedEvent *)event;
- X
- X! /* translate coordinates on zoomed canvas to object
- X! coordinates */
- X! x = BACKX(event->x);
- X! y = BACKY(event->y);
- X if (magnet_mode)
- X {
- X! if (appres.INCHES) /* inch system */
- X! {
- X! x = ((t = x % 5) < 2/*3*/) ? x - t - 1 : x + 5 - t - 1;
- X! y = ((t = y % 5) < 2) ? y - t - 1 : y + 5 - t - 1;
- X! }
- X! else /* metric system - allow for 2 grid sizes */
- X! {
- X! if (grid2_mode)
- X! {
- X! x = ((t = x % 15) < 7/*8*/) ? x - t - 1 : x + 15 - t - 1;
- X! y = ((t = y % 15) < 7) ? y - t - 1 : y + 15 - t - 1;
- X! }
- X! else
- X! {
- X! x = ((t = x % 3) < 1/*2*/) ? x - t - 1 : x + 3 - t - 1;
- X! y = ((t = y % 3) < 1) ? y - t - 1 : y + 3 - t - 1;
- X! }
- X! }
- X }
- X switch (event->type)
- X {
- X***************
- X*** 196,217 ****
- X &cx, &cy,
- X &mask);
- X if(cx == sx && cy == sy) break;
- X! x = sx = cx;
- X! y = sy = cy;
- X }
- X set_rulermark(x, y);
- X (*canvas_locmove_proc)(x, y);
- X break;
- X case ButtonPress:
- X if (be->button & Button1)
- X! (*canvas_leftbut_proc)(x, y);
- X else if (be->button & Button2)
- X! (*canvas_middlebut_proc)(x, y);
- X break;
- X case KeyPress:
- X! if (XLookupString(ke, buf, sizeof(buf), NULL, NULL) > 0)
- X! (*canvas_kbd_proc)((unsigned char)buf[0]);
- X! break;
- X }
- X }
- X
- X--- 219,265 ----
- X &cx, &cy,
- X &mask);
- X if(cx == sx && cy == sy) break;
- X! x = sx = BACKX(cx); /* these are zoomed */
- X! y = sy = BACKY(cy); /* coordinates! */
- X }
- X set_rulermark(x, y);
- X (*canvas_locmove_proc)(x, y);
- X break;
- X case ButtonPress:
- X+ /* new: propagate state of shift key to clients */
- X if (be->button & Button1)
- X! (*canvas_leftbut_proc)(x, y, be->state&ShiftMask);
- X else if (be->button & Button2)
- X! (*canvas_middlebut_proc)(x, y, be->state&ShiftMask);
- X break;
- X case KeyPress:
- X! /* if arrow keys are pressed, pan */
- X! t=XLookupKeysym(ke,0);
- X! if (t==XK_Left||
- X! t==XK_Right ||
- X! t==XK_Up ||
- X! t==XK_Down)
- X! { switch(t)
- X! { case XK_Left: zoomxoff-=ZOOMSTEP;
- X! if (zoomxoff<0) zoomxoff=0;
- X! break;
- X! case XK_Up: zoomyoff-=ZOOMSTEP;
- X! if (zoomyoff<0) zoomyoff=0;
- X! break;
- X! case XK_Right: zoomxoff+=ZOOMSTEP;
- X! break;
- X! case XK_Down: zoomyoff+=ZOOMSTEP;
- X! break;
- X! }
- X! setup_rulers();
- X! redisplay_rulers();
- X! setup_grid(0);
- X! }
- X! else
- X! { if (XLookupString(ke, buf, sizeof(buf),NULL,NULL) > 0)
- X! (*canvas_kbd_proc)((unsigned char)buf[0]);
- X! }
- X! break;
- X }
- X }
- X
- X*** @xfig.pl9/change.c Tue Oct 16 08:33:15 1990
- X--- ./change.c Fri Jun 14 14:20:14 1991
- X***************
- X*** 26,32 ****
- X #include "font.h"
- X #include "psfonts.h"
- X
- X- #define TOLERANCE 7
- X #define min(a, b) (((a) < (b)) ? (a) : (b))
- X #define max(a, b) (((a) > (b)) ? (a) : (b))
- X
- X--- 26,31 ----
- X***************
- X*** 42,55 ****
- X extern null_proc();
- X extern set_popupmenu();
- X
- X- extern F_text *text_search();
- X
- X extern int foreground_color, background_color;
- X extern Pixmap font_menu_bitmaps[];
- X! extern int *font_sel; /* pointer to store font selected from popup */
- X! extern Widget image_widget; /* which widget to store image of font in */
- X extern Window canvas_win;
- X
- X extern change_text();
- X extern change_item();
- X extern change_depth_up();
- X--- 41,57 ----
- X extern null_proc();
- X extern set_popupmenu();
- X
- X
- X extern int foreground_color, background_color;
- X extern Pixmap font_menu_bitmaps[];
- X!
- X! extern int *font_sel; /* pointer to store font selected from popup */
- X! extern Widget image_widget; /* which widget to store image of font in */
- X extern Window canvas_win;
- X
- X+ extern int init_object_search();
- X+ extern int object_search();
- X+
- X extern change_text();
- X extern change_item();
- X extern change_depth_up();
- X***************
- X*** 66,83 ****
- X static get_f_pos();
- X static points_panel();
- X static get_points();
- X! static XtCallbackProc toggle(), done_button(), apply_button(), cancel_button();
- X static void line_style_select();
- X static void text_adjust_select();
- X static Widget popup, form;
- X static Widget below, beside;
- X
- X! extern F_line *line_search(), *copy_line();
- X! extern F_arc *arc_search(), *copy_arc();
- X! extern F_ellipse *ellipse_search(), *copy_ellipse();
- X! extern F_text *text_search(), *copy_text();
- X! extern F_spline *spline_search(), *copy_spline();
- X! extern F_compound *compound_search();
- X extern F_arrow *forward_arrow(), *backward_arrow();
- X extern F_compound objects;
- X
- X--- 68,85 ----
- X static get_f_pos();
- X static points_panel();
- X static get_points();
- X! static XtCallbackProc toggle_fill(), done_button(),
- X! apply_button(), cancel_button();
- X static void line_style_select();
- X static void text_adjust_select();
- X static Widget popup, form;
- X static Widget below, beside;
- X
- X! extern F_line *copy_line();
- X! extern F_arc *copy_arc();
- X! extern F_ellipse *copy_ellipse();
- X! extern F_text *copy_text();
- X! extern F_spline *copy_spline();
- X extern F_arrow *forward_arrow(), *backward_arrow();
- X extern F_compound objects;
- X
- X***************
- X*** 91,96 ****
- X--- 93,99 ----
- X extern int RHS_PANL;
- X extern float cur_dashlength;
- X extern float cur_dotgap;
- X+ extern int line_thickness;
- X
- X /* not use init_change();*/
- X static int done_compound();
- X***************
- X*** 114,119 ****
- X--- 117,123 ----
- X static Widget angle_panel;
- X static Widget adjust_panel;
- X static Widget area_fill_panel;
- X+ static Widget dash_label;
- X static Widget fill_pct_label;
- X static Widget style_panel;
- X static Widget style_val_panel;
- X***************
- X*** 208,214 ****
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! canvas_leftbut_proc = change_item;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X return_proc = change_item_selected;
- X--- 212,220 ----
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! /* store handler address with object_search */
- X! init_object_search(change_item);
- X! canvas_leftbut_proc = object_search;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X return_proc = change_item_selected;
- X***************
- X*** 217,231 ****
- X }
- X
- X
- X! change_item(x, y)
- X int x, y;
- X {
- X- extern F_line *line_search();
- X- extern F_arc *arc_search();
- X- extern F_ellipse *ellipse_search();
- X- extern F_text *text_search();
- X- extern F_spline *spline_search();
- X- extern F_compound *compound_search();
- X F_line *l;
- X F_arc *a;
- X F_ellipse *e;
- X--- 223,233 ----
- X }
- X
- X
- X! change_item(p,type,x, y)
- X! char *p;
- X! int type;
- X int x, y;
- X {
- X F_line *l;
- X F_arc *a;
- X F_ellipse *e;
- X***************
- X*** 232,259 ****
- X F_text *t;
- X F_spline *s;
- X F_compound *c;
- X- int dummy;
- X
- X
- X! if ((l = line_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL) {
- X! make_window_line(l);
- X }
- X- else if ((t = text_search(x, y)) != NULL) {
- X- make_window_text(t);
- X- }
- X- else if ((e = ellipse_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL){
- X- make_window_ellipse(e);
- X- }
- X- else if ((a = arc_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL){
- X- make_window_arc(a);
- X- }
- X- else if ((s = spline_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL) {
- X- make_window_spline(s);
- X- }
- X- else if ((c = compound_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL)
- X- make_window_compound(c);
- X- else
- X- return;
- X
- X XtPopup(popup, XtGrabExclusive);
- X }
- X--- 234,256 ----
- X F_text *t;
- X F_spline *s;
- X F_compound *c;
- X
- X
- X! switch(type)
- X! { case O_POLYLINE: make_window_line((F_line *) p);
- X! break;
- X! case O_TEXT: make_window_text((F_text *) p);
- X! break;
- X! case O_ELLIPSE: make_window_ellipse((F_ellipse *) p);
- X! break;
- X! case O_ARC: make_window_arc((F_arc *) p);
- X! break;
- X! case O_SPLINE: make_window_spline((F_spline *) p);
- X! break;
- X! case O_COMPOUND: make_window_compound((F_compound *) p);
- X! break;
- X! default: return;
- X }
- X
- X XtPopup(popup, XtGrabExclusive);
- X }
- X***************
- X*** 474,480 ****
- X {
- X F_text *old_text;
- X
- X! draw_text(new_text, INV_PAINT);
- X old_text = new_text->next;
- X switch (button_result) {
- X case APPLY:
- X--- 471,477 ----
- X {
- X F_text *old_text;
- X
- X! draw_text(new_text, ERASE);
- X old_text = new_text->next;
- X switch (button_result) {
- X case APPLY:
- X***************
- X*** 836,842 ****
- X insert_text(&objects.texts, tnew);
- X set_latesttext(told);
- X told->next = tnew;
- X! draw_text(told, INV_PAINT);
- X draw_text(tnew, PAINT);
- X }
- X
- X--- 833,839 ----
- X insert_text(&objects.texts, tnew);
- X set_latesttext(told);
- X told->next = tnew;
- X! draw_text(told, ERASE);
- X draw_text(tnew, PAINT);
- X }
- X
- X***************
- X*** 851,856 ****
- X--- 848,855 ----
- X generic_vals.thickness = atoi(panel_get_value(thickness_panel));
- X generic_vals.color = atoi(panel_get_value(color_panel));
- X generic_vals.depth = atoi(panel_get_value(depth_panel));
- X+ /* include dash length in panel, too */
- X+ generic_vals.style_val = (float) atof(panel_get_value(style_val_panel));
- X if (!no_fill_flag)
- X {
- X val = panel_get_value(area_fill_panel);
- X***************
- X*** 956,961 ****
- X--- 955,962 ----
- X int i, fill, dist;
- X Widget image;
- X Pixmap image_pm;
- X+ Pixel fg,bg;
- X+ Arg arg[2];
- X
- X static char * menu_item_names[] = {
- X "Solid Line ", "Dashed Line", "Dotted Line"};
- X***************
- X*** 993,1014 ****
- X break;
- X }
- X }
- X /* doesn't already exist, create a pixmap from the data (ala panel.c) */
- X if (!image_pm)
- X {
- X image_pm = XCreateBitmapFromData(tool_d, canvas_win,
- X icon->data, icon->width, icon->height);
- X pix_table[i].image_pm = image_pm;
- X pix_table[i].image = icon;
- X }
- X! n=0;
- X! XtSetArg(args[n], XtNbitmap, image_pm); n++;
- X! XtSetArg(args[n], XtNfromHoriz, label); n++;
- X! XtSetArg(args[n], XtNtop, XtChainTop); n++;
- X! XtSetArg(args[n], XtNbottom, XtChainTop); n++;
- X! XtSetArg(args[n], XtNleft, XtChainRight); n++;
- X! XtSetArg(args[n], XtNright, XtChainRight); n++;
- X! image = XtCreateManagedWidget("image", labelWidgetClass, form, args, n);
- X
- X /* get height of label widget and distance between widgets */
- X n = 0;
- X--- 994,1029 ----
- X break;
- X }
- X }
- X+ n=0;
- X+ XtSetArg(args[n], XtNfromHoriz, label); n++;
- X+ XtSetArg(args[n], XtNtop, XtChainTop); n++;
- X+ XtSetArg(args[n], XtNbottom, XtChainTop); n++;
- X+ XtSetArg(args[n], XtNleft, XtChainRight); n++;
- X+ XtSetArg(args[n], XtNright, XtChainRight); n++;
- X+ image = XtCreateManagedWidget("image", labelWidgetClass, form, args, n);
- X+
- X /* doesn't already exist, create a pixmap from the data (ala panel.c) */
- X if (!image_pm)
- X {
- X+ /* OpenWindows bug doesn't handle the one-plane bitmap on a multi-plane display */
- X+ #ifdef OPENWIN
- X+ XtSetArg(args[0], XtNforeground, &fg); /* get the foreground/background of the widget */
- X+ XtSetArg(args[1], XtNbackground, &bg);
- X+ XtGetValues(image, args, TWO);
- X+
- X+ image_pm = XCreatePixmapFromBitmapData(tool_d, canvas_win,
- X+ icon->data, icon->width, icon->height,
- X+ fg, bg, XDefaultDepthOfScreen(tool_s));
- X+ #else
- X image_pm = XCreateBitmapFromData(tool_d, canvas_win,
- X icon->data, icon->width, icon->height);
- X+ #endif
- X pix_table[i].image_pm = image_pm;
- X pix_table[i].image = icon;
- X }
- X! /* now put in the bitmap */
- X! XtSetArg(args[0], XtNbitmap, image_pm);
- X! XtSetValues(image,args,ONE);
- X
- X /* get height of label widget and distance between widgets */
- X n = 0;
- X***************
- X*** 1050,1057 ****
- X int_panel(generic_vals.color, "Color:", &color_panel);
- X int_panel(generic_vals.depth, "Depth:", &depth_panel);
- X
- X! if (generic_vals.area_fill == 0 ||
- X! strcmp(sub_type,"Polyline") == 0) /* no area fill for polyline */
- X {
- X fill = 100;
- X no_fill_flag = TRUE;
- X--- 1065,1073 ----
- X int_panel(generic_vals.color, "Color:", &color_panel);
- X int_panel(generic_vals.depth, "Depth:", &depth_panel);
- X
- X! /*if (generic_vals.area_fill == 0 ||
- X! strcmp(sub_type,"Polyline") == 0)*/ /* no area fill for polyline */
- X! if (generic_vals.area_fill == 0)
- X {
- X fill = 100;
- X no_fill_flag = TRUE;
- X***************
- X*** 1062,1083 ****
- X no_fill_flag = FALSE;
- X }
- X
- X! if (strcmp(sub_type,"Polyline") != 0) /* no area fill for polyline */
- X! {
- X! toggle_panel(no_fill_flag, no_fill_flag? "Not Filled": "Filled ",
- X! &filled_panel);
- X! int_panel(fill,"Fill%:", &area_fill_panel);
- X! fill_pct_label = beside; /* save pointer to Fill% label */
- X! XtSetArg(args[0], XtNsensitive, no_fill_flag? False: True);
- X! XtSetArg(args[1], XtNvertDistance, 2);
- X! XtSetValues(area_fill_panel, args, TWO);
- X! XtSetValues(fill_pct_label, args, TWO);
- X! if (no_fill_flag)
- X! sprintf(buf," ");
- X! else
- X! sprintf(buf,"%d",fill);
- X! panel_set_value(area_fill_panel,buf);
- X! }
- X
- X /* make popup line style menu */
- X
- X--- 1078,1092 ----
- X no_fill_flag = FALSE;
- X }
- X
- X! toggle_panel(no_fill_flag, no_fill_flag? "Not Filled": "Filled ",
- X! &filled_panel);
- X! int_panel(fill,"Fill%:", &area_fill_panel);
- X! fill_pct_label = beside; /* save pointer to Fill% label */
- X! XtSetArg(args[0], XtNsensitive, no_fill_flag? False: True);
- X! XtSetArg(args[1], XtNvertDistance, 2);
- X! XtSetValues(area_fill_panel, args, TWO);
- X! XtSetValues(fill_pct_label, args, TWO);
- X! panel_clear_value(area_fill_panel);
- X
- X /* make popup line style menu */
- X
- X***************
- X*** 1088,1093 ****
- X--- 1097,1114 ----
- X below = style_panel;
- X menu = make_popup_menu(menu_item_names, XtNumber(menu_item_names),
- X style_panel, line_style_select);
- X+ /* new field for style_val */
- X+ float_panel(generic_vals.style_val, "Dash Length/Dot Gap:", &style_val_panel);
- X+ /* save pointer to dash/dot gap label panel */
- X+ dash_label = beside;
- X+ if (generic_vals.style == SOLID_LINE)
- X+ {
- X+ XtSetArg(args[0], XtNsensitive, False);
- X+ XtSetValues(style_val_panel, args, ONE);
- X+ XtSetValues(dash_label, args, ONE);
- X+ /* and clear any value from the dash length panel */
- X+ panel_clear_value(style_val_panel);
- X+ }
- X #ifdef notdef
- X
- X }
- X***************
- X*** 1207,1212 ****
- X--- 1228,1255 ----
- X below = *pi_x;
- X }
- X
- X+ static
- X+ float_panel(x, label, pi_x)
- X+ float x;
- X+ char *label;
- X+ Widget *pi_x;
- X+ {
- X+ char buf[32];
- X+
- X+ XtSetArg(args[0], XtNfromVert, below);
- X+ XtSetArg(args[1], XtNlabel, label);
- X+ beside = XtCreateManagedWidget(label, labelWidgetClass, form, args, TWO);
- X+
- X+ sprintf(buf, "%1.1f", x);
- X+ XtSetArg(args[1], XtNstring, buf);
- X+ XtSetArg(args[2], XtNinsertPosition, strlen(buf));
- X+ XtSetArg(args[3], XtNfromHoriz, beside);
- X+ XtSetArg(args[4], XtNeditType, "append");
- X+ XtSetArg(args[5], XtNwidth, 40);
- X+ *pi_x = XtCreateManagedWidget(label, asciiTextWidgetClass, form, args, SIX);
- X+ below = *pi_x;
- X+ }
- X+
- X /* don't allow newlines in text until we handle multiple line texts */
- X
- X static String text_translations =
- X***************
- X*** 1250,1255 ****
- X--- 1293,1300 ----
- X if (nlines > 6) /* limit to displaying 6 lines and show scrollbars */
- X nlines=6;
- X n=0;
- X+ if (nlines == 1) /* if only one line, allow space for scrollbar */
- X+ nlines=2;
- X XtSetArg(args[n], XtNfromVert, below); n++;
- X XtSetArg(args[n], XtNstring, string); n++;
- X XtSetArg(args[n], XtNinsertPosition, strlen(string)); n++;
- X***************
- X*** 1277,1283 ****
- X XtSetArg(args[1], XtNlabel, label);
- X XtSetArg(args[2], XtNvalue, x);
- X *pi_x = XtCreateManagedWidget(label, toggleWidgetClass, form, args, THREE);
- X! XtAddCallback(*pi_x, XtNcallback, toggle, NULL);
- X below = *pi_x;
- X }
- X
- X--- 1322,1328 ----
- X XtSetArg(args[1], XtNlabel, label);
- X XtSetArg(args[2], XtNvalue, x);
- X *pi_x = XtCreateManagedWidget(label, toggleWidgetClass, form, args, THREE);
- X! XtAddCallback(*pi_x, XtNcallback, toggle_fill, NULL);
- X below = *pi_x;
- X }
- X
- X***************
- X*** 1480,1485 ****
- X--- 1525,1531 ----
- X Widget w;
- X XtPointer style, garbage;
- X {
- X+ char buf[10]; /* buffer for style_val text */
- X
- X XtSetArg(args[0], XtNlabel, XtName(w));
- X XtSetValues(style_panel, args, ONE);
- X***************
- X*** 1489,1503 ****
- X switch(generic_vals.style)
- X {
- X case SOLID_LINE:
- X! generic_vals.style_val = 0.0;
- X break;
- X case DASH_LINE:
- X! generic_vals.style_val = cur_dashlength;
- X break;
- X case DOTTED_LINE:
- X! generic_vals.style_val = cur_dotgap;
- X break;
- X }
- X }
- X
- X static void
- X--- 1535,1565 ----
- X switch(generic_vals.style)
- X {
- X case SOLID_LINE:
- X! /*generic_vals.style_val = 0.0;*/
- X! XtSetArg(args[0], XtNsensitive, False);
- X! /* clear out any dash length number from panel */
- X! sprintf(buf," ");
- X break;
- X case DASH_LINE:
- X! /* if style_val contains no useful value, set it to the
- X! default dashlength, scaled by the line thickness */
- X! if (generic_vals.style_val<0.1)
- X! generic_vals.style_val = cur_dashlength*(line_thickness+1)/2;
- X! sprintf(buf,"%1.1f",generic_vals.style_val);
- X! XtSetArg(args[0], XtNsensitive, True);
- X break;
- X case DOTTED_LINE:
- X! if (generic_vals.style_val<0.1)
- X! generic_vals.style_val = cur_dotgap*(line_thickness+1)/2;
- X! sprintf(buf,"%1.1f",generic_vals.style_val);
- X! XtSetArg(args[0], XtNsensitive, True);
- X break;
- X }
- X+ /* make both the label and value panels sensitive or insensitive */
- X+ XtSetValues(style_val_panel, args, ONE);
- X+ XtSetValues(dash_label, args, ONE);
- X+ /* put the value in the value panel */
- X+ panel_set_value(style_val_panel,buf);
- X }
- X
- X static void
- X***************
- X*** 1511,1526 ****
- X text_adjust = (int) adjust;
- X }
- X
- X-
- X static XtCallbackProc
- X! toggle(w, clos, garbage)
- X Widget w;
- X XtPointer clos, garbage;
- X! {
- X char buf[5];
- X int fill;
- X
- X! if(no_fill_flag == TRUE)
- X no_fill_flag = FALSE;
- X else
- X no_fill_flag = TRUE;
- X--- 1573,1587 ----
- X text_adjust = (int) adjust;
- X }
- X
- X static XtCallbackProc
- X! toggle_fill(w, clos, garbage)
- X Widget w;
- X XtPointer clos, garbage;
- X! {
- X char buf[5];
- X int fill;
- X
- X! if (no_fill_flag == TRUE)
- X no_fill_flag = FALSE;
- X else
- X no_fill_flag = TRUE;
- X***************
- X*** 1536,1544 ****
- X fill = (NUMFILLPATS - generic_vals.area_fill) * (100/(NUMFILLPATS-1));
- X if (fill > 100)
- X fill = 100;
- X if (no_fill_flag)
- X sprintf(buf," ");
- X else
- X sprintf(buf,"%d",fill);
- X panel_set_value(area_fill_panel,buf);
- X! }
- X--- 1597,1614 ----
- X fill = (NUMFILLPATS - generic_vals.area_fill) * (100/(NUMFILLPATS-1));
- X if (fill > 100)
- X fill = 100;
- X+ /* if fill is off, blank out fill % value */
- X if (no_fill_flag)
- X sprintf(buf," ");
- X else
- X sprintf(buf,"%d",fill);
- X panel_set_value(area_fill_panel,buf);
- X! }
- X!
- X! panel_clear_value(w)
- X! Widget w;
- X! {
- X! char buf[2];
- X! sprintf(buf," ");
- X! panel_set_value(w,buf);
- X! }
- X*** @xfig.pl9/char.c Wed Aug 1 15:41:24 1990
- X--- ./char.c Wed Jun 12 11:15:43 1991
- X***************
- X*** 11,16 ****
- X--- 11,17 ----
- X #include "font.h"
- X #include "paintop.h"
- X #include "object.h"
- X+ #include "zoom.h"
- X
- X extern int cur_x, cur_y;
- X extern int cur_font, cur_fontsize;
- X***************
- X*** 37,43 ****
- X draw_cursor(x, y)
- X int x, y;
- X {
- X! pw_vector(pw, x, y, x, y-char_ht, INV_PAINT, 1, SOLID_LINE, 0.0);
- X }
- X
- X initialize_char_handler(p, cr, bx, by)
- X--- 38,44 ----
- X draw_cursor(x, y)
- X int x, y;
- X {
- X! pw_vector(pw, x, y, x, y-char_ht, INV_PAINT, 1, RUBBER_LINE, 0.0);
- X }
- X
- X initialize_char_handler(p, cr, bx, by)
- X***************
- X*** 59,84 ****
- X
- X terminate_char_handler()
- X {
- X turn_off_blinking_cursor();
- X cr_proc = NULL;
- X! return(char_received);
- X }
- X
- X erase_char_string()
- X {
- X! pw_text(pw, cbase_x, cbase_y, INV_PAINT,
- X cur_font, cur_fontsize, prefix);
- X if (leng_suffix)
- X! pw_text(pw, cur_x, cbase_y, INV_PAINT,
- X cur_font, cur_fontsize, suffix);
- X }
- X
- X draw_char_string()
- X {
- X! pw_text(pw, cbase_x, cbase_y, INV_PAINT,
- X cur_font, cur_fontsize, prefix);
- X if (leng_suffix)
- X! pw_text(pw, cur_x, cbase_y, INV_PAINT,
- X cur_font, cur_fontsize, suffix);
- X move_blinking_cursor(cur_x, cur_y);
- X }
- X--- 60,90 ----
- X
- X terminate_char_handler()
- X {
- X+ int save_char_rec;
- X+
- X turn_off_blinking_cursor();
- X+ erase_char_string();
- X cr_proc = NULL;
- X! save_char_rec = char_received;
- X! char_received = 0;
- X! return(save_char_rec);
- X }
- X
- X erase_char_string()
- X {
- X! pw_text(pw, cbase_x, cbase_y, ERASE,
- X cur_font, cur_fontsize, prefix);
- X if (leng_suffix)
- X! pw_text(pw, cur_x, cbase_y, ERASE,
- X cur_font, cur_fontsize, suffix);
- X }
- X
- X draw_char_string()
- X {
- X! pw_text(pw, cbase_x, cbase_y, PAINT,
- X cur_font, cur_fontsize, prefix);
- X if (leng_suffix)
- X! pw_text(pw, cur_x, cbase_y, PAINT,
- X cur_font, cur_fontsize, suffix);
- X move_blinking_cursor(cur_x, cur_y);
- X }
- X***************
- X*** 145,159 ****
- X else {
- X erase_char_string();
- X cwidth = char_advance(canvas_font,c);
- X if (cur_textjust == T_LEFT_JUSTIFIED)
- X! rcur_x += cwidth; /* move the suffix to the right */
- X else if (cur_textjust == T_CENTER_JUSTIFIED)
- X! {
- X! rbase_x -= cwidth/2.0; /* advance left by half cwidth */
- X! rcur_x += cwidth/2.0; /* move suffix right half cwidth */
- X }
- X if (cur_textjust == T_RIGHT_JUSTIFIED)
- X! rbase_x -= cwidth; /* move the prefix to the left */
- X char_received = 1;
- X prefix[leng_prefix++] = c;
- X prefix[leng_prefix] = '\0';
- X--- 151,170 ----
- X else {
- X erase_char_string();
- X cwidth = char_advance(canvas_font,c);
- X+ /* note: text dimensions must be corrected for the
- X+ zoom factor! */
- X if (cur_textjust == T_LEFT_JUSTIFIED)
- X! /* move the suffix to the right */
- X! rcur_x += cwidth/zoomscale;
- X else if (cur_textjust == T_CENTER_JUSTIFIED)
- X! { /* advance left by half cwidth */
- X! rbase_x -= cwidth/2.0/zoomscale;
- X! /* move suffix right half cwidth */
- X! rcur_x += cwidth/2.0/zoomscale;
- X }
- X if (cur_textjust == T_RIGHT_JUSTIFIED)
- X! /* move the prefix to the left */
- X! rbase_x -= cwidth/zoomscale;
- X char_received = 1;
- X prefix[leng_prefix++] = c;
- X prefix[leng_prefix] = '\0';
- X*** @xfig.pl9/const.h Wed Aug 1 15:19:00 1990
- X--- ./const.h Mon Jun 3 11:16:27 1991
- X***************
- X*** 14,20 ****
- X #define DEF_CANVAS_WIDTH_P 8*PIX_PER_INCH
- X
- X /* Landscape dimensions */
- X! #define DEF_CANVAS_HEIGHT_L 8*PIX_PER_INCH
- X #define DEF_CANVAS_WIDTH_L 10*PIX_PER_INCH
- X
- X #define RULER_WIDTH 20
- X--- 14,20 ----
- X #define DEF_CANVAS_WIDTH_P 8*PIX_PER_INCH
- X
- X /* Landscape dimensions */
- X! #define DEF_CANVAS_HEIGHT_L 8.5*PIX_PER_INCH
- X #define DEF_CANVAS_WIDTH_L 10*PIX_PER_INCH
- X
- X #define RULER_WIDTH 20
- X*** @xfig.pl9/copy.c Fri Sep 21 09:38:39 1990
- X--- ./copy.c Mon Jun 3 13:25:16 1991
- X***************
- X*** 35,41 ****
- X extern F_compound objects;
- X
- X extern char cut_buf_name[];
- X- extern char *sys_errlist[];
- X extern int pointmarker_shown;
- X
- X extern int copy_selected();
- X--- 35,40 ----
- X***************
- X*** 42,47 ****
- X--- 41,49 ----
- X extern int init_copy();
- X extern int init_file_cut();
- X
- X+ extern int init_object_search();
- X+ extern int object_search();
- X+
- X static (*save_kbd_proc)();
- X static (*save_locmove_proc)();
- X static (*save_leftbut_proc)();
- X***************
- X*** 55,61 ****
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! canvas_leftbut_proc = init_copy;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X return_proc = copy_selected;
- X--- 57,65 ----
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! /* store handler address with object_search */
- X! init_object_search(init_copy);
- X! canvas_leftbut_proc = object_search;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X return_proc = copy_selected;
- X***************
- X*** 63,70 ****
- X reset_action_on();
- X }
- X
- X! init_copy(x, y)
- X int x, y;
- X {
- X F_line *l, *line;
- X F_ellipse *e, *ellipse;
- X--- 67,77 ----
- X reset_action_on();
- X }
- X
- X! init_copy(p,type,x, y,px,py)
- X! char *p;
- X! int type;
- X int x, y;
- X+ int px,py;
- X {
- X F_line *l, *line;
- X F_ellipse *e, *ellipse;
- X***************
- X*** 72,80 ****
- X F_spline *s, *spline;
- X F_arc *a, *arc;
- X F_compound *c, *compound;
- X- int px, py;
- X
- X! if ((c = compound_search(x, y, TOLERANCE, &px, &py)) != NULL) {
- X compound = copy_compound(c);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X--- 79,88 ----
- X F_spline *s, *spline;
- X F_arc *a, *arc;
- X F_compound *c, *compound;
- X
- X! switch(type)
- X! { case O_COMPOUND:
- X! c=(F_compound *) p;
- X compound = copy_compound(c);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X***************
- X*** 84,91 ****
- X insert_compound(&objects.compounds, compound);
- X set_latestcompound(compound);
- X init_compounddragging(compound, px, py);
- X! }
- X! else if ((l = line_search(x, y, TOLERANCE, &px, &py)) != NULL) {
- X line = copy_line(l);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X--- 92,100 ----
- X insert_compound(&objects.compounds, compound);
- X set_latestcompound(compound);
- X init_compounddragging(compound, px, py);
- X! break;
- X! case O_POLYLINE:
- X! l=(F_line *) p;
- X line = copy_line(l);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X***************
- X*** 95,102 ****
- X insert_line(&objects.lines, line);
- X set_latestline(line);
- X init_linedragging(line, px, py);
- X! }
- X! else if ((t = text_search(x, y)) != NULL) {
- X text = copy_text(t);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X--- 104,112 ----
- X insert_line(&objects.lines, line);
- X set_latestline(line);
- X init_linedragging(line, px, py);
- X! break;
- X! case O_TEXT:
- X! t=(F_text *) p;
- X text = copy_text(t);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X***************
- X*** 105,112 ****
- X insert_text(&objects.texts, text);
- X set_latesttext(text);
- X init_textdragging(text, x, y);
- X! }
- X! else if ((e = ellipse_search(x, y, TOLERANCE, &px, &py)) != NULL) {
- X ellipse = copy_ellipse(e);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X--- 115,123 ----
- X insert_text(&objects.texts, text);
- X set_latesttext(text);
- X init_textdragging(text, x, y);
- X! break;
- X! case O_ELLIPSE:
- X! e=(F_ellipse *) p;
- X ellipse = copy_ellipse(e);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X***************
- X*** 116,123 ****
- X insert_ellipse(&objects.ellipses, ellipse);
- X set_latestellipse(ellipse);
- X init_ellipsedragging(ellipse, px, py);
- X! }
- X! else if ((a = arc_search(x, y, TOLERANCE, &px, &py)) != NULL) {
- X arc = copy_arc(a);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X--- 127,135 ----
- X insert_ellipse(&objects.ellipses, ellipse);
- X set_latestellipse(ellipse);
- X init_ellipsedragging(ellipse, px, py);
- X! break;
- X! case O_ARC:
- X! a=(F_arc *) p;
- X arc = copy_arc(a);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X***************
- X*** 127,134 ****
- X insert_arc(&objects.arcs, arc);
- X set_latestarc(arc);
- X init_arcdragging(arc, px, py);
- X! }
- X! else if ((s = spline_search(x, y, TOLERANCE, &px, &py)) != NULL) {
- X spline = copy_spline(s);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X--- 139,147 ----
- X insert_arc(&objects.arcs, arc);
- X set_latestarc(arc);
- X init_arcdragging(arc, px, py);
- X! break;
- X! case O_SPLINE:
- X! s=(F_spline *) p;
- X spline = copy_spline(s);
- X erase_pointmarker();
- X set_temp_cursor(&null_cursor);
- X***************
- X*** 138,148 ****
- X insert_spline(&objects.splines, spline);
- X set_latestspline(spline);
- X init_splinedragging(spline, px, py);
- X! }
- X! else
- X return;
- X- canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
- X }
- X
- X file_cut_selected()
- X {
- X--- 151,162 ----
- X insert_spline(&objects.splines, spline);
- X set_latestspline(spline);
- X init_splinedragging(spline, px, py);
- X! break;
- X! default:
- X return;
- X }
- X+ canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
- X+ }
- X
- X file_cut_selected()
- X {
- END_OF_FILE
- if test 51690 -ne `wc -c <'patch10.1'`; then
- echo shar: \"'patch10.1'\" unpacked with wrong size!
- fi
- # end of 'patch10.1'
- fi
- echo shar: End of archive 3 \(of 4\).
- cp /dev/null ark3isdone
- MISSING=""
- for I in 1 2 3 4 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 4 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- --
- Dan Heller
- O'Reilly && Associates Z-Code Software Comp-sources-x:
- Senior Writer President comp-sources-x@uunet.uu.net
- argv@ora.com argv@zipcode.com
-